﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
using Microsoft.AspNet.SignalR.WebSockets;
namespace Cherrs.IM.Server.Core
{
    public class test1 : HubPipelineModule
    {
       
        protected override bool OnBeforeConnect(IHub hub)
        {
             Console.WriteLine(hub.Context.ConnectionId);
            return true;
        }
        protected override bool OnBeforeIncoming(IHubIncomingInvokerContext context)
        {
            //context.Hub.Clients.Caller.Registermessage("error");
            return true;
        }
    }


    public class DefaultWebSocketHandler : WebSocketHandler
    {
        
        public DefaultWebSocketHandler(int? maxIncomingMessageSize) : base(maxIncomingMessageSize)
        {

        }
        public override void OnError()
        {
            Console.WriteLine("有错误");
        }
    }
}
